#include<iostream>
#include<string>
using namespace std;
int main(void){
	string str = "";
	char space = ' ';
    getline(cin,str);
    int cnt = 0;
    for(int i = str.rfind(space) + 1;i < str.size();i++){
        cnt++;
    }
    cout<<cnt;
	return 0;
}
